<div class="col4 simpleFlexCol">
  <% if (ob.errors['title']) print(ob.formErrorTmpl({ errors: ob.errors['title'] })) %>
  <input type="text" class="clrBr clrP clrSh2 marginTopAuto" name="title" value="<%= ob.title %>" placeholder="<%= ob.polyT('editListing.coupons.titlePlaceholder') %>" maxlength=<%= ob.max.titleLength %>>
</div>
<div class="col4 simpleFlexCol">
  <% if (ob.errors['discountCode']) print(ob.formErrorTmpl({ errors: ob.errors['discountCode'] })) %>
  <input type="text" class="clrBr clrP clrSh2 marginTopAuto" name="discountCode" value="<%= ob.discountCode %>" placeholder="<%= ob.polyT('editListing.coupons.discountCodePlaceholder') %>">
</div>
<div class="col4 simpleFlexCol">
  <% if (ob.errors['percentDiscount']) print(ob.formErrorTmpl({ errors: ob.errors['percentDiscount'] })) %>
  <% if (ob.errors['bigPriceDiscount']) print(ob.formErrorTmpl({ errors: ob.errors['bigPriceDiscount'] })) %>
  <div class="flexRow marginTopAuto">
    <div class="inputSelect marginTopAuto">
      <%
        let discountAmount;

        if (ob.bigPriceDiscount) {
          discountAmount = ob.number.toStandardNotation(ob.bigPriceDiscount);
        } else if (typeof ob.percentDiscount !== 'undefined') {
          discountAmount =  ob.number.toStandardNotation(ob.percentDiscount);
        }

        const isFixedDiscount = !!ob.bigPriceDiscount;
      %>
      <input type="text" class="clrBr clrP clrSh2" name="discountAmount" value="<%= discountAmount %>" placeholder="0.00">
      <select name="discountType" class="clrBr clrP nestInputRight">
        <option value="PERCENTAGE" <% if (!isFixedDiscount) print('selected') %>><%= ob.polyT('editListing.coupons.discountTypePercent') %></option>
        <option value="FIXED" <% if (isFixedDiscount) print('selected') %>><%= ob.polyT('editListing.coupons.discountTypeFixed') %></option>
      </select>
    </div>

    <a class="iconBtn clrBr clrP clrSh2 margLSm toolTipNoWrap js-btnRemoveCoupon btnRemoveCoupon" data-tip="<%= ob.polyT('editListing.coupons.toolTip.delete') %>">
      <i class="ion-trash-b"></i>
    </a>
  </div>
</div>
